li01.onmouseover=function(){
    ul02.style.display="block";
}
li01.onmouseout=function(){
    ul02.style.display="none";
}
var arrs=["../img/01-1.jpg","../img/01-2.jpg","../img/01-3.jpg"];
f1=function(){
    var first=arrs.shift();
    arrs.push(first);
    lef.style.background="url("+arrs[0]+")center no-repeat" ;
}
//			lef.style.background="url(../../img/01-1.jpg) center no-repeat" ;
f1();
timer=setInterval(function(){
    f1();
},2000);
lef.onmouseover=function(){
    clearInterval(timer);
}
lef.onmouseout=function(){
    timer=setInterval(function(){
    f1();
},3000);
}
var ips=document.getElementsByTagName("input");
console.log(ips)
for(var i=1;i<5;i++){
    ips[i].onfocus=function(){
        if(this.name=="nc"){
            this.style.border="1px solid #3487ff";
        }else if(this.name=="mm"){
            this.style.border="1px solid #3487ff";
        }else if(this.name=="sjh"){
            this.style.border="1px solid #3487ff";
        }else if(this.name=="yzm"){
            this.style.border="1px solid #3487ff";
        }
    }
}

for(var i=1;i<5;i++){
    ips[i].onblur=function(){
//		    		console.log(2)
        if(this.name=="nc"){
            if(this.value==""){
                for1.style.display="block";
                tick1.style.display="none";
                this.style.border="1px solid  #ff5b5b";
            }else{
                tick1.style.display="block";
                for1.style.display="none";
                this.style.border="1px solid #999";
            }
        }else if(this.name=="mm"){
            if(this.value==""){
                for2.style.display="block";
                tick2.style.display="none";
                this.style.border="1px solid  #ff5b5b";
                for5.style.display="none";
                for6.style.display="none";
                for7.style.display="none";
//		    				console.log(1);
            }else{
                console.log(this.value);
                if(this.value.length<8){
//		    					console.log(this.value.length);
                    for6.style.display="block";
                    for7.style.display="none"
                    for6p.style.color="#ff5b5b";
                    for2.style.display="none";
                    for5.style.display="none";
                    for53.style.display="inline-block";
                    for54.style.display="none";
                    tick2.style.display="none";
                }else{
                    for5.style.display="none";
                    for56.style.display="inline-block"
//		    					var reg=/(?!^(\d+|[a-zA-Z]+|[~!@#$%^&*?]+)$)^[\w~!@#$%^&*?]$/
                    var reg=/^(?![0-9]+$)(?![A-Za-z]+$)(?![~!@#$%^&*?]+$)[0-9A-Za-z~!@#$%^&*?]{8,16}$/;
                    if(reg.test(this.value)){
                        tick2.style.display="block";
                        this.style.border="1px solid #999";
                        for7.style.display="none";
                        for6.style.display="none";
                    }else{
                        tick2.style.display="none";
                        for7.style.display="block";
                        for6.style.display="none";
                        for57.style.display="none";
                        for58.style.display="none";
                        for7p.style.color="#ff5b5b";
                    }
                }
            }
        }else if(this.name=="sjh"){
            if(this.value==""){
                for8.style.display="block";
                tick3.style.display="none";
                this.style.border="1px solid  #ff5b5b";
            }else{
                var reg1=/^(\+86|0086)?[\s]*[1][3-9][0-9]{9}$/;
                if(reg1.test(this.value)){
                    tick3.style.display="block";
                    for8.style.display="none";
                    this.style.border="1px solid #999";
                }else{
                    for8.style.display="block";
                    tick3.style.display="none";
                    this.style.border="1px solid  #ff5b5b";
                }
            }
        }else if(this.name=="yzm"){
            this.style.border="1px solid #999";
        }
    }
}
ips[2].oninput=function(){
//              console.log(ips[2].value);
    for5.style.display="block";
    for6.style.display="block";
    for7.style.display="block";
    for53.style.display="none";
    for56.style.display="none";
    for6p.style.color="#000";
    for7p.style.color="#000";
    var reg2=/^[^\s]*$/;
    if(reg2.test(ips[2].value)){
        for52.style.display="inline-block";
        for51.style.display="none";
//              	console.log(111);
    }else{
        for52.style.display="none";
        for51.style.display="inline-block";
    }
    
    if(ips[2].value.length<8){
        for54.style.display="inline-block";
        for55.style.display="none";
    }else{
        for54.style.display="none";
        for55.style.display="inline-block";
    }
    
    var reg=/^(?![0-9]+$)(?![A-Za-z]+$)(?![~!@#$%^&*?]+$)[0-9A-Za-z~!@#$%^&*?]{8,16}$/;
    if(reg.test(ips[2].value)){
        for58.style.display="inline-block";
        for57.style.display="none";
    }else{
        for58.style.display="none";
        for57.style.display="inline-block";
    }
}
    ips[2].onclick=function(){
//              console.log(ips[2].value);
    for2.style.display="none";
    for5.style.display="block";
    for6.style.display="block";
    for7.style.display="block";
    for53.style.display="none";
    for56.style.display="none";
    for6p.style.color="#000";
    for7p.style.color="#000";
    var reg2=/^[^\s]*$/;
    if(reg2.test(ips[2].value)){
        for52.style.display="inline-block";
        for51.style.display="none";
//              	console.log(111);	
    }else{
        for52.style.display="none";
        for51.style.display="inline-block";
    }
    
    if(ips[2].value.length<8){
        for54.style.display="inline-block";
        for55.style.display="none";
    }else{
        for54.style.display="none";
        for55.style.display="inline-block";
    }
    
    var reg=/^(?![0-9]+$)(?![A-Za-z]+$)(?![~!@#$%^&*?]+$)[0-9A-Za-z~!@#$%^&*?]{8,16}$/;
    if(reg.test(ips[2].value)){
        for58.style.display="inline-block";
        for57.style.display="none";
    }else{
        for58.style.display="none";
        for57.style.display="inline-block";
    }
}
let code = "";	    
ips[5].onclick=function(){
    code = "";
    var arr=[];
    for (var i=48;i<=57;i++){
        arr.push(String.fromCharCode(i));
    }
    for (var i=65;i<=90;i++){
        arr.push(String.fromCharCode(i));
    }
    for (var i=97;i<=122;i++){
        arr.push(String.fromCharCode(i));
    }
//			    console.log(arr);
    while(code.length<4){
        var r=parseInt(Math.random()*(arr.length));
        if(code.indexOf(arr[r])==-1){
            code+=arr[r];
        }
    }
			    // console.log(code);
    ips[4].placeholder=code;
}
$("form").submit(() =>{
    let code1 = $(".ipt1")[0].value.toUpperCase();
    let code2 = code.toUpperCase();
    if(code1 == ""){
        return false;
    }
    if(code1 != code2){
        return false;
    }
    for(let i = 1 ; i < 4 ; i++){
        if($($(ips[i])[0].nextElementSibling).css("display") == "none"){
            return false;
        }
    }
})
